package MathCore.Operands;

import MathCore.Lexeme;
import MathCore.Operand;

public class Variable extends Operand
{
	private Operand value;

	public Variable()
	{
		name = "";
		editable = false;
	}
	
	public Variable(Operand v, String n)
	{
		value = v;
		name = n;
		editable = false;
	}

	public Variable(Variable v)
	{
		if(v.get() != null) value = (Operand) v.get().clone();
		name = v.toString();
		editable = false;
	}

	public Lexeme clone()
	{
		return new Variable(this);
	}

	public String getName()
	{
		return name;
	}

	public Operand get()
	{
		return value;
	}

	public void set(Operand value)
	{
		this.value = value;
	}

	public String toString()
	{
		return name;
	}
}
